﻿import { createCrudApi } from '@/utils/apiFactory';
import request from '@/utils/unirequest';
import type { ISysNotification, ISysNotificationView, ISysNotificationVm } from './interface';

export default function SysNotificationApi() {
  // 基础CRUD用工厂生成
  const baseCrud = createCrudApi<
    ISysNotificationView,
    ISysNotificationVm,
    ISysNotification
  >('/api/SysNotification');

  return {
    ...baseCrud,

    // 额外的特殊接口
    async MarkAllAsRead(): Promise<void> {
      return await request.post('/api/SysNotification/MarkAllAsRead', {});
    },
  };
}